home *** CD-ROM | disk | FTP | other *** search
/ Business Shareware / Business Shareware.iso / start / gfxapps / pbmpl91d / pbmplus / makefile < prev    next >
Makefile  |  1993-01-08  |  8KB  |  175 lines

  1. .SUFFIXES:    .out .a .o .c
  2.  
  3. # Makefile for pbmplus tools.
  4. #
  5. # Copyright (C) 1989, 1991 by Jef Poskanzer.
  6. #
  7. # Permission to use, copy, modify, and distribute this software and its
  8. # documentation for any purpose and without fee is hereby granted, provided
  9. # that the above copyright notice appear in all copies and that both that
  10. # copyright notice and this permission notice appear in supporting
  11. # documentation.  This software is provided "as is" without express or
  12. # implied warranty.
  13.  
  14. # CONFIGURE: gcc makes things go faster on some machines, but not everyone
  15. # has it.  Warning: do not use gcc's -finline-functions or -fstrength-reduce
  16. # flags, they can produce incorrect code.  (This is with gcc versions 1.35,
  17. # 1.36, and 1.37, later versions may fix these bugs.)  Also, on some systems
  18. # gcc can't compile pnmconvol - dunno why.  And on some systems you can't
  19. # use the -ansi flag, it gives compilation errors in <math.h>.
  20. #CC =         cc
  21. CC =       gcc
  22. #CC =        gcc -fcombine-regs -fpcc-struct-return
  23. #CC =        gcc -ansi -pedantic
  24.  
  25. # CONFIGURE: cc flags go here.
  26. #CFLAGS =     -O
  27. #CFLAGS =    -g
  28. CFLAGS =   -g -O2 -funroll-loops
  29.  
  30. # CONFIGURE: ld flags go here.  Eunice users may want to use -noshare so that
  31. # the binaries can run standalone.
  32. LDFLAGS =    -s
  33. #LDFLAGS =    
  34. #LDFLAGS =    -noshare
  35.  
  36. # CONFIGURE: If you have an X11-style rgb color names file, define its
  37. # path here.  This is used by PPM to parse color names into rgb values.
  38. # If you don't have such a file, comment this out and use the alternative
  39. # hex and decimal forms to specify colors (see ppm/pgmtoppm.1 for details).
  40. #RGBDEF =     -DRGB_DB=\"/usr/lib/X11/rgb\"
  41.  
  42. # CONFIGURE: PBMPLUS's support for TIFF files depends on the library from
  43. # Sam Leffler's TIFF Software package - see the OTHER.SYSTEMS file for a
  44. # full description and access information.  To configure PBMPLUS to use the
  45. # library: first, if necessary, fetch the TIFF Software, unpack it in a
  46. # scratch directory somewhere, and move the libtiff subdirectory right here
  47. # into the PBMPLUS top-level directory.  Configure and "make" in the
  48. # libtiff directory.  Yes, you do have to do the TIFF make by hand, the
  49. # general PBMPLUS make will *not* make libtiff.  Finally, uncomment the
  50. # following five definitions.
  51. #
  52. # Libtiff is pretty good about portability, but there are some machines
  53. # it has problems on.  If you run into problems, you may wish to contact
  54. # Sam directly, at the address listed in the OTHER.SYSTEMS file.
  55. #
  56. # By the way, you must have at least version 2.4 of libtiff.  Earlier
  57. # versions will not work.
  58. TIFFDEF =    -DLIBTIFF
  59. TIFFINC =    -I../libtiff
  60. TIFFLIB =    ../libtiff/libtiff.a
  61. TIFFBINARIES =    tifftopnm pnmtotiff
  62. TIFFOBJECTS =    tifftopnm.o pnmtotiff.o
  63.  
  64. # CONFIGURE: Define the directory that you want the binaries copied to.
  65. # If you need scripts and binaries to be in different directories, you
  66. # can set that up too.
  67. INSTALLBINARIES =    /usr/new/pbmplus
  68. INSTALLSCRIPTS =    $(INSTALLBINARIES)
  69.  
  70. # CONFIGURE: Define the directories that you want the manual sources copied to,
  71. # plus the suffix you want them to have.
  72. INSTALLMANUALS1 =    /usr/man/mann
  73. SUFFIXMANUALS1 =    n
  74. INSTALLMANUALS3 =    /usr/man/mann
  75. SUFFIXMANUALS3 =    n
  76. INSTALLMANUALS5 =    /usr/man/mann
  77. SUFFIXMANUALS5 =    n
  78.  
  79. # CONFIGURE: Normally the man pages are installed using "cp".  By changing
  80. # this define you can use something else, for example a script that calls
  81. # compress or pack.
  82. MANCP =            cp
  83.  
  84. # CONFIGURE: Normally the Makefiles build and install separate binaries for
  85. # each program.  However, on some systems (especially those without shared
  86. # libraries) this can mean a lot of space.  In this case you might try
  87. # building a "merge" instead.  The idea here is to link all the binaries
  88. # together into one huge executable, with a tiny dispatch program as the
  89. # main.  Then the merged binary is installed with file-system links for
  90. # each program it includes.  The dispatch routine can tell which program
  91. # to run by looking at argv[0].  On a Sun3 under SunOS 3.5 the space for
  92. # executables went from 2.9 meg to .36 meg.
  93. #
  94. # Note that if you make a "merge", the executables don't get created
  95. # until you do the install.
  96. all:        binaries
  97. install:    install.bin install.man
  98. #all:        merge
  99. #install:    install.merge install.man
  100.  
  101. # End of configurable definitions.
  102.  
  103. MAKE =        make
  104. SUBDIRS =    pbm pgm ppm pnm
  105.  
  106. binaries:
  107.          cd pbm
  108.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries
  109.          cd ..
  110.          cd pgm
  111.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries
  112.          cd ..
  113.          cd ppm
  114.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries
  115.          cd ..
  116.          cd pnm
  117.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries
  118.          cd ..
  119.  
  120. #    for i in $(SUBDIRS) ; do \
  121. #        ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' binaries ); \
  122. #    done
  123.  
  124. merge:
  125.          cd pbm
  126.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' merge
  127.          cd ..
  128.          cd pgm
  129.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' merge
  130.          cd ..
  131.          cd ppm
  132.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' merge
  133.          cd ..
  134.          cd pnm
  135.          $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' merge
  136.          cd ..
  137.  
  138. #    for i in $(SUBDIRS) ; do \
  139. #        ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' merge ); \
  140. #    done
  141.  
  142. install.bin:
  143.     for i in $(SUBDIRS) ; do \
  144.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' install.bin ); \
  145.     done
  146.  
  147. install.merge:
  148.     for i in $(SUBDIRS) ; do \
  149.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'CC=$(CC)' 'CFLAGS=$(CFLAGS)' 'RGBDEF=$(RGBDEF)' 'TIFFDEF=$(TIFFDEF)' 'TIFFINC=$(TIFFINC)' 'TIFFLIB=$(TIFFLIB)' 'TIFFBINARIES=$(TIFFBINARIES)' 'TIFFOBJECTS=$(TIFFOBJECTS)' 'LDFLAGS=$(LDFLAGS)' 'INSTALLBINARIES=$(INSTALLBINARIES)' 'INSTALLSCRIPTS=$(INSTALLSCRIPTS)' install.merge ); \
  150.     done
  151.  
  152. install.man:
  153.     for i in $(SUBDIRS) ; do \
  154.         ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) 'TIFFBINARIES=$(TIFFBINARIES)' 'INSTALLMANUALS1=$(INSTALLMANUALS1)' 'SUFFIXMANUALS1=$(SUFFIXMANUALS1)' 'INSTALLMANUALS3=$(INSTALLMANUALS3)' 'SUFFIXMANUALS3=$(SUFFIXMANUALS3)' 'INSTALLMANUALS5=$(INSTALLMANUALS5)' 'SUFFIXMANUALS5=$(SUFFIXMANUALS5)' 'MANCP=$(MANCP)' install.man ); \
  155.     done
  156.  
  157. clean:
  158.     -rm -f *.shar *.shar? art.*
  159.     cd pbm
  160.     $(MAKE) $(MFLAGS) clean
  161.     cd ..
  162.     cd pgm
  163.     $(MAKE) $(MFLAGS) clean
  164.     cd ..
  165.     cd ppm
  166.     $(MAKE) $(MFLAGS) clean
  167.     cd ..
  168.     cd pnm
  169.     $(MAKE) $(MFLAGS) clean
  170.     cd ..
  171.  
  172. #    for i in $(SUBDIRS) ; do \
  173. #        ( echo $$i ; cd $$i ; $(MAKE) $(MFLAGS) clean ); \
  174. #    done
  175.